var select = document.querySelector('.select')
var s1s = select.querySelectorAll('.s1')
var showName = document.querySelector('.showName')
var Myname = showName.querySelector('.name')
var code = showName.querySelector('.code')
showName.addEventListener('click', function() {
    console.log(1);
    select.style.display = 'block'
})
select.addEventListener('click',function () {
    for(var i = 0; i < s1s.length; i++) {
        s1s[i].addEventListener('click',function() {
            for(var i = 0; i < s1s.length; i++) {
                s1s[i].className = 's1';
            }
            var Myname1 = this.querySelector('.name')
            var code1 = this.querySelector('.code')
            console.log(Myname1);
            console.log(code1);
            this.className = 's1 color_select'
            Myname.innerHTML = Myname1.innerHTML;
            code.innerHTML = code1.innerHTML + '<div class="icon"></div>'
            select.style.display = 'none'
        })
        }
    }
)